package com.binhthuan.catechist.client.grid;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.smartgwt.client.widgets.grid.ListGridRecord;

public interface IGrid {
    public interface ViewButtonClickHandler extends EventHandler {
        void onClick(ListGridRecord selectedRecord);
    }

    public interface DeleteButtonClickHandler extends EventHandler {
        void onClick(ListGridRecord selectedRecord);
    }

    public interface EditButtonClickHandler extends EventHandler {
        void onClick(ListGridRecord selectedRecord);
    }

    /**
     * Add a handler that will be called when user click edit button
     * 
     * @param handler
     * @return HandlerRegistration
     */
    HandlerRegistration addEditButtonHandler(EditButtonClickHandler handler);

    /**
     * Add a handler that will be called when user click view button
     * 
     * @param handler
     * @return HandlerRegistration
     */
    HandlerRegistration addViewButtonHandler(ViewButtonClickHandler handler);

    /**
     * Add a handler that will be called when user click delete button
     * 
     * @param handler
     * @return HandlerRegistration
     */
    HandlerRegistration addDeleteButtonHandler(DeleteButtonClickHandler handler);
}
